//获取应用实例
Page({
  data: {
    inputShowed: false,
    inputVal: ''
  },

  onLoad: function (options) {
    var that = this;
    var inputVal = options.inputVal;
    wx.request({
      url: 'https://ke.slickghost.com/beta/search.php',
      headers: {
        'Content-Type': 'application/json'
      },
      data: {
        inputVal: inputVal
      },
      success: function (res) {
        //将获取到的json数据，存在名字叫array的这个数组中
        if(res.data != null){
          that.setData({
            array: res.data
          })
        }
        else{
            array: 0
        }
      }
    }) 
  }
})